package com.haiyou.dc.netty.entity;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import javax.persistence.*;
import java.io.Serializable;

import java.util.Date;

/**
 * 聊天记录表
 *
 * @author Administrator
 * @date 2020-02-29 22:49:56
 */
@ApiModel(value = "聊天记录表")
@Data
@Accessors(chain = true)
@Table(name = "im_chat")
public class ImChat implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 消息id
     */
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @ApiModelProperty(value = "消息id", name = "id")
    private String id;

    /**
     * 发送者
     */
    @Column(name = "sender")
    @ApiModelProperty(value = "发送者", name = "sender")
    private String sender;

    /**
     * 接收者
     */
    @Column(name = "receiver")
    @ApiModelProperty(value = "接收者", name = "receiver")
    private String receiver;

    /**
     * 消息来源：0普通聊天
     */
    @Column(name = "source")
    @ApiModelProperty(value = "消息来源：0普通聊天", name = "source")
    private String source;

    /**
     * 消息内容
     */
    @Column(name = "content")
    @ApiModelProperty(value = "消息内容", name = "content")
    private String content;

    /**
     * 消息体
     */
    @Column(name = "body")
    @ApiModelProperty(value = "消息体", name = "body")
    private String body;

    /**
     * 消息类型：1单聊，2群聊
     */
    @Column(name = "type")
    @ApiModelProperty(value = "消息类型：1单聊，2群聊", name = "type")
    private String type;

    /**
     * 内容类型，1text，2image，3sound，4date
     */
    @Column(name = "msg_type")
    @ApiModelProperty(value = "内容类型，1text，2image，3sound，4date", name = "msgType")
    private String msgType;

    /**
     * 是否签收，1是，0否，默认为0
     */
    @Column(name = "sign")
    @ApiModelProperty(value = "是否签收，1是，0否，默认为0", name = "sign")
    private String sign;

    /**
     * 创建时间
     */
    @Column(name = "create_time")
    @ApiModelProperty(value = "创建时间", name = "createTime")
    private Date createTime;

}
